import { getEmpInfo } from '../../../../api/basic'
import { ref } from 'vue'
import { EmpInfo } from '../types'

// 获取职员信息加载
const getEmpInfoLoading = ref(false)

// 职员信息
const empInfo = ref<EmpInfo | null>(null)

// 获取职员信息方法
const getEmpInfoFn = async (id: string, empId: string) => {
  getEmpInfoLoading.value = true
  const res = await getEmpInfo(id, empId)
  getEmpInfoLoading.value = false
  empInfo.value = res.data.data.row
}

export default {
  empInfo,
  getEmpInfoLoading,
  getEmpInfoFn,
}
